cmake_minimum_required(VERSION 3.10)
project(parallel_test)

set(CMAKE_CXX_STANDARD 14)

#dubug 模式
set (CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -g")
#c++ mulit threads need this
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

include_directories(/home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/include/python3.6m) 
include_directories(/home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/lib/python3.6/site-packages/numpy/core/include) 

# find required opencv
# find_package(OpenCV 3 REQUIRED)
# directory of opencv headers
# include_directories(${OpenCV_INCLUDE_DIRS})

set(CMAKE_PREFIX_PATH "/home/st/ubuntu_data/software/libtorch-shared-with-deps-1.7.1+cu101/libtorch") #注意这里填自己解压libtorch时的路径
find_package(Torch REQUIRED)
include_directories(
        ${TORCH_INCLUDE_DIRS}
)




add_executable(cpp_python_test1 main.cpp)
 target_link_libraries(cpp_python_test1
         /home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/lib/libpython3.6m.so) 

add_executable(cpp_python_test2 cpp_python_test.cpp)
 target_link_libraries(cpp_python_test2
         /home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/lib/libpython3.6m.so) 

add_executable(cpp_python_test3 cpp_python_test3.cpp)
target_link_libraries(cpp_python_test3
          /home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/lib/libpython3.6m.so
          ) 

add_executable(cpp_python_test4 cpp_python_test4.cpp)
target_link_libraries(cpp_python_test4
          /home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/lib/libpython3.6m.so
          ) 

add_executable(cpp_python_test5 cpp_python_test5.cpp)
target_link_libraries(cpp_python_test5
          /home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/lib/libpython3.6m.so
          ) 

add_executable(paralle_test paralle_test.cpp)

add_executable(paralle_call_pytorch paralle_call_pytorch.cpp)
target_link_libraries(paralle_call_pytorch
        ${TORCH_LIBRARIES}
          ) 
    

#export PYTHONHOME="/home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre"
#cmake .. "-DCMAKE_PREFIX_PATH=/home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre"

#!/home/st/ubuntu_data/software/miniconda3/envs/ciassd_tra_pre/bin/python
